//
//  HCMineAppTableViewCell.m
//  HappyChildren
//
//  Created by WillyZhao on 2017/1/21.
//  Copyright © 2017年 WillyZhao. All rights reserved.
//

#import "HCMineAppTableViewCell.h"

#import "HCMineAppointmentModel.h"



@implementation HCMineAppTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.lineView.backgroundColor = YBKRGBCOLOR(242, 242, 242, 1);
    
    self.topView.backgroundColor = YBKRGBCOLOR(242, 242, 242, 1);
    
    // Initialization code
}

-(void)setModel:(id)model {
    HCMineAppointmentData *data = (HCMineAppointmentData *)model;
    
    self.state.text = [NSString stringWithFormat:@"%@",data.appointment_stat];
    
    if ([self.state.text isEqualToString:@"预约中"]) {
        self.state.textColor = YBKRGBCOLOR(240, 96, 96, 1);
    }else if([self.state.text isEqualToString:@"确认中"]){
        self.state.textColor = [UIColor redColor];
    }else{
        self.state.textColor = [UIColor lightGrayColor];
    }
    
    self.time.text = [NSString stringWithFormat:@"%@",[PublicFunction getDateFromNSString:data.appointment_time]];
    
    self.title.text = [NSString stringWithFormat:@"%@",data.name];
    
    [self.headIMG sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",data.pic]]];
    self.storeAbout.text = [NSString stringWithFormat:@"%@",data.appointment_info];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
